package com.sutuijingling.result;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.UUID;
import org.apache.commons.io.b;

public abstract class e extends a {
    protected static boolean g = true;
    public static String h = "http://www.154158.com";

    public e() {
        this.a = new b(d(), b(), f());
    }

    public e(boolean z) {
        g = z;
        this.a = new b(d(), b(), f());
    }

    public static String a(String str) {
        String str2 = "";
        try {
            File file = new File("/data/data/jp.jun_nama.test.utf7ime/files/imei.txt");
            if (!file.exists()) {
                File file2 = new File("/data/local/tmp/guid.txt");
                if (!file2.exists()) {
                    str2 = UUID.randomUUID().toString().replace("-", "");
                    FileWriter fileWriter = new FileWriter("/data/local/tmp/guid.txt");
                    fileWriter.write(str2);
                    fileWriter.flush();
                    fileWriter.close();
                }
                return b.b(file2).trim();
            } else if (str2 != "") {
                return str2;
            } else {
                str2 = b.b(file).trim();
                if (str2 != "" || new File("/data/local/tmp/guid.txt").exists()) {
                    return str2;
                }
                str2 = UUID.randomUUID().toString();
                FileWriter fileWriter2 = new FileWriter("/data/local/tmp/guid.txt");
                fileWriter2.write(str2);
                fileWriter2.flush();
                fileWriter2.close();
                return str2;
            }
        } catch (IOException e) {
            e.printStackTrace();
            return "123456";
        }
    }

    public static String e() {
        String str = "";
        try {
            File file = new File("/data/data/jp.jun_nama.test.utf7ime/files/bssid.txt");
            return !file.exists() ? "" : b.b(file).trim();
        } catch (IOException e) {
            e.printStackTrace();
            return str;
        }
    }

    protected void a(e eVar, Long l, String str) {
        String valueOf = String.valueOf(l);
        eVar.a.a("missionId", valueOf);
        eVar.a.a("key", str);
        System.out.println(" do auto private key :" + str);
        try {
            eVar.a.a("idSign", com.sutuijingling.bean.b.a(valueOf, str));
        } catch (c e) {
            e.printStackTrace();
        }
    }

    protected void a(e eVar, String str) {
        eVar.a.a("key", str);
        System.out.println(" do auto private key :" + str);
        try {
            eVar.a.a("idSign", com.sutuijingling.bean.b.a(str, str));
        } catch (c e) {
            e.printStackTrace();
        }
    }

    protected String d() {
        return h;
    }

    protected boolean f() {
        return false;
    }
}
